package com.kgis.map.events {
    import com.kgis.map.control.legend.LegendDisplayItem;
    import com.kgis.map.control.legend.TreeGridChkItemRanderer;
    
    import flash.events.Event;
    
    import mx.collections.ArrayCollection;

    /**
     * 图列控制项消息
     */
    public class LegendCtrlEvent extends Event {
        /**用户点击checkbox框，传递的消息. 树节点向legendctrl发的消息*/
        public static const TREENODE_CHECKCHANGED:String = "treeNodeCheckchanged";
        public static const TREENODE_REFRESH:String = "treeReFresh";
		public static const TREENODE_NODEREFRESH:String = "treeNodeReFresh";
		public static const TREENODE_ERROR:String = "treeNodeError";
        public var legendItemName:String = "";
        /**用户选中的节点名称*/
        public var legendItem:LegendDisplayItem;
        /**是否被选种*/
        public var bIsChecked:Boolean;
		public var sender:TreeGridChkItemRanderer;
		public var selectArr:ArrayCollection;
        public function LegendCtrlEvent(type:String, ... rest) {
            super(type, true, true);

            switch (type) {
                case TREENODE_CHECKCHANGED:
                    legendItem = rest[0];
                    bIsChecked = rest[1];
					sender=rest[2];
                    break;
				case TREENODE_NODEREFRESH:
					selectArr = rest[0];
					bIsChecked = rest[1];
					sender = rest[2];
					break;
                default:
                    break;
            }
        }

        override public function clone():Event {
            return this;
        }
    }
}